package cn.lyvust.args;

/**
 * 数据类型共有两种:基本数据类型和引用数据类型
 * 引用数据类型:类、数字和接口以及字符串String
 * date: 2021-3-31 21:14
 *
 * @author Guo_guo
 * @since JDK 1.8
 */
public class StudentTest {
    public static void main(String[] args) {
        Student zhang = new Student();
        zhang.name = "张三";
        zhang.age = 22;
        zhang.work();
        String res = zhang.doSomeThing("睡觉");
        System.out.println(res);

        Calc calc = new Calc();
        int n = 8;
        calc.calc1(8);
        calc.calc2(zhang);
        System.out.println("n = " + n + ", student.age =" + zhang.age);

        int arr[] = new int[2];
        arr[0] = 2;
        calc.cal3(arr);
        System.out.println("在cal3外部,数组修改之后:" + arr[0]);

        String str1 = new String("这是一个字符串");
        res = calc.calc4(str1);
        System.out.println(str1);
    }
}
